/*
 * @(#)TelnetCommand.java	1.0 Apr 26, 2008
 *
 *	The MIT License
 *
 *	Copyright (c) 2008 Malachi de AElfweald <malachid@gmail.com>
 *
 *	Permission is hereby granted, free of charge, to any person obtaining a copy
 *	of this software and associated documentation files (the "Software"), to deal
 *	in the Software without restriction, including without limitation the rights
 *	to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 *	copies of the Software, and to permit persons to whom the Software is
 *	furnished to do so, subject to the following conditions:
 *
 *	The above copyright notice and this permission notice shall be included in
 *	all copies or substantial portions of the Software.
 *
 *	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 *	IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 *	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 *	AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 *	LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 *	OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 *	THE SOFTWARE.
 */
package org.eoti.net.telnet;

public enum TelnetCommand
{
	// see http://www.scit.wlv.ac.uk/~jphb/comms/telnet.html

	// Between SB and SE, we need to specify whether a value is required/supplied
	OptionRequired(1), // <IAC><SB><option code number><OptionRequired><IAC><SE>
	OptionSupplied(0), // <IAC><SB><option code><OptionSupplied>value<IAC><SE>

	// Subnegotiation End parameters
	SE(240), SubnegotiationEnd(240),

	// No OPeration
	NOP(241), NoOperation(241),

	// Data Mark; indicates Synch event
	// Some things like AO and IP require immediate attention and may be used because of misbehaving processes
	// a DM in a TCP Urgent package signifies the receiver to search for "interesting" characters like AO,IP,AYT
	// especially useful if remote end is waiting for input and client is not expecting to send any
	// has no effect unless in a TCP Urgent package
	// this process is known as a 'telnet sync' mechanism
	DM(242), DataMark(242),

	// BReaK; Break or Attention key was hit
	BRK(243), Break(243),

	// Interrupt Process; suspend, interrupt or abort process
	// usually caused by CTRL-C on client
	IP(244), InterruptProcess(244),

	// Abort Output; finish what you are doing, but quit telling me about it
	AO(245), AbortOutput(245),

	// Are You There; send back some visible proof that connection still established
	AYT(246), AreYouThere(246),

	// Erase Character; receiver should delete last preceding undeleted character from data stream
	EC(247), EraseCharacter(247),

	// Erase Line; delete back to but not including CRLF
	EL(248), EraseLine(248),

	// Go Ahead; sometimes used to signify that other end can transmit
	GA(249), GoAhead(249),

	// Subnegotiation Begin parameters
	SB(250), SubnegotiationBegin(250),

	WILL(251),	// WILL you - or - I WILL
	WONT(252),	// I WON'T
	DO(253),		// please DO - or - I know you will DO
	DONT(254),	// please DON'T - or - I know you will NOT DO

	// Interpret As Command
	IAC(255), InterpretAsCommand(255);

	TelnetCommand(int value)
	{
		this.value = value;
	}
	protected int value;
	public int getValue(){return value;}
}
